import request from '@/utils/request.js'
const PATH = '/admin/route'

// 获取所有地理信息
export const getGeography = () => request.get(PATH + '/getGeography')

// 新增线路
export const addRoute = (data) => request.post(PATH + '/add', data)

// 获取线路列表
export const getRouteList = ({ page, pageSize, name, geographyId }) =>
  request.get(PATH + '/pageQuery', {
    params: {
      page,
      pageSize,
      name,
      geographyId
    }
  })

//  删除线路
export const deleteByIds = (ids) =>
  request.delete(PATH + '/deleteByIds', {
    params: {
      ids: ids.join(',')
    }
  })

// 修改线路
export const updateRoute = (data) => request.put(PATH + '/update', data)
